<?php $lib->alert($alert); ?>

<div class="col-md-12 row" >
  <form method="post" action="" enctype="multipart/form-data">
  <div class="col-lg-7 left-f">
  	 <header class="panel panel-primary" >
        <h4>General Information</h4>
    </header>
      <div class="form-group">
          <label for="title">Title</label>
          <input 
          	 value="<?php if(isset($detail)) echo $detail->title ?>"
          	 class="form-control" 
             name="data[title]" 
             id="title" 
             required autofocus>
         
      </div>
     
      <div class="form-group">
            <label>Category</label>
           
            <div class="checkbox">
               
                	<select
                    	name="data[parentid]" 
                        class="form-control"
                        type="radio" 
                        value="<?php echo $item['id']; ?> ">
                         <?php 
							foreach($list_category as $key=>$item)
							{
								if(is_array($item))
								{
						 ?>
                        		<option 
                                
									value="<?php echo  $item['id']; ?>"
                                    <?php if($detail->parentid == $item['id']) echo "selected";  ?>
                                    >
                                    
									<?php   echo  $item['title']; ?>
                                </option>
                        <?php
								}
							}
						?> 
                    
                    
                    </select>
                   
                     
               
            </div>
            
           
            
      </div>
      
      <?php //$lib->loadmenu(); ?>
     
      
      <div class="form-group">
          <label for="tags">Tags</label>
          <input 
          	 value="<?php if(isset($detail)) echo $detail->tags ?>"
          	 class="form-control" 
             name="data[tags]" 
             id="tags" >
         
      </div>
     
       <div class="form-group">
          <label for="icon">Image</label>
          <?php if(isset($detail)){?>
          <div class="row">
             <img 
              style="border:1px solid #c0c0c0; 
                padding:2px; 
              	border-radius:7px; 
              	margin-left:30px; 
             	margin-bottom:30px; 
              	margin-top:13px;"
              width="80"
              height="80"
              src="<?php echo $detail->image;  ?>" 
              alt="<?php echo $detail->title;  ?>" 
              title="<?php echo $detail->title;  ?>">  
          </div>
          <?php } ?>
          <div class="row">
             <p class="col-md-10">
             <input 
             	value="<?php if(isset($detail)) echo $detail->image ?>"
             	class="form-control" 
                name="data[image]" 
                id="image"  >
             </p>
             <p class="col-md-2"><button onclick="browseKCFinder('image', 'image');return false;"  class="btn btn-primary">Chọn</button></p>
          </div>
      </div>
  </div>
  <div class="col-lg-4  right-f">
  	   <header class="panel panel-primary" >
       		<h4>Advance</h4>
       </header>
       <div class="form-group">
            <label for="publish">Display</label>
            <div class="col-md-12">
           		 <p class="col-md-4">
                     <input 
                     	<?php if(isset($detail)){ 
							if($detail->publish==1) echo "checked";
							} else echo "checked"; 
						?>
                        value="1" 
                        type="radio" 
                        name="data[publish]" 
                        id="publish">
                     <b style="padding-left:5px;">Yes</b>
                 </p>
           		 <p class="col-md-4">
                     <input 
                     	<?php if(isset($detail)){ 
							if($detail->publish==0) echo "checked";
							}  else echo ""; 
						?>
                         
                        value="0" 
                        type="radio" 
                        name="data[publish]" 
                        id="publish"> 
                     <b style="padding-left:5px;">No</b>
                 </p>
             </div>              
       </div>
       <div class="form-group">
            <label for="hot">Hot</label>
            <div class="col-md-12">
           		 <p class="col-md-4">
                	 <input 
                     	<?php if(isset($detail)){ 
							if($detail->hot==1) echo "checked";
							}  else echo ""; 
						?>
                     	value="1" 
                        type="radio" 
                        name="data[hot]" 
                        id="hot"> 
                    <b style="padding-left:5px;">Yes</b>
                 </p>
           		 <p class="col-md-4">
                 	<input 
                    	<?php if(isset($detail)){ 
							if($detail->hot==0) echo "checked";
							}  else echo "checked"; 
						?>
                    	 
                        value="0" 
                        type="radio" 
                        name="data[hot]" 
                        id="hot"> 
                    <b style="padding-left:5px;">No</b>
                 </p>
             </div>              
       </div>
       
        <div class="form-group">
          <label for="timer">Time post</label>
          <input class="form-control" name="data[timer]" id="timer" >  
        </div>
        <div class="form-group">
          <label for="meta_title">Meta Title:</label>
          <input  value="<?php if(isset($detail)) echo $detail->meta_title ?>" class="form-control" name="data[meta_title]" id="meta_title" >  
        </div>
         <div class="form-group">
          <label for="meta_keywords">Meta Keywords:</label>
          <input value="<?php if(isset($detail)) echo $detail->meta_keywords ?>" class="form-control" name="data[meta_keywords]" id="meta_keywords" >  
        </div>
        
           
  </div>
   <div class="col-md-12" style="padding-bottom:3em">
   	   <br>
       <div class="form-group">
            <label for="description">Desciption</label>
           <p class="row" style="overflow:auto;">
           	<textarea class="wysiwygEditor description" name="data[description]" id="description" >
            	<?php if(isset($detail)) echo $detail->description ?>
            </textarea>
           </p>
        </div>
        <div class="form-group">
            <label for="content">Content</label>
            <p class="row" style="overflow:auto;">
            	<textarea class="wysiwygEditor content" name="data[content]" id="content">
                	<?php if(isset($detail)) echo $detail->content ?>
                </textarea>
            </p>
        </div>
  </div>
  <div class="col-md-12" style="padding-bottom:3em">
  	  <div class="col-md-2 col-sm-6">
      	 <button type="reset" class="btn btn-danger">Reset</button>
      </div>
       <div class="col-md-2 col-sm-6">
      	 <button type="submit" class="btn btn-primary" name="btnGui">Change</button>
      </div>    
  </div>
  </form>
</div>
<!-- /.row -->
